package String;

public class test7 {
    public static void main(String[] args) {
        //定义一个字符串记录身份证号
        String id="321281202001011234";

        //取出年月日
        String year=id.substring(6,10);
        String mouth=id.substring(10,12);
        String day=id.substring(12,14);

        System.out.println("人物信息为：");
        System.out.println("出生年月日："+year+"年"+mouth+"月"+day+"日");

        //获取性别
        char gender = id.charAt(16);
        int num=gender-48;
        if(num%2==0){
            System.out.println("性别：女");
        }else {
            System.out.println("性别：男");
        }
    }
}
